﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Web.Models.UIComponent.Onglet
{
    public class OngletViewModelBuilder
    {
        private OngletViewModel model;

        private int count;

        public OngletViewModelBuilder(int count)
        {
            this.count = count;
        }

        public OngletViewModelBuilder Foreach(Func<int, OngletViewModelItem> getValue)
        {
            for (int i = 0; i < count; i++)
			{
                model.Items.Add(getValue(i));
			}

            return this;
        }

        public OngletViewModel Build()
        {
            return model;
        }
    }
}